﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NetDon.WebControls;
using NetDon.eBoss.Data.CollectionClasses;
using NetDon.eBoss.Data.EntityClasses;
using NetDon.Utilities;
namespace NetDon.OA.Portal.HtmlTool
{
    public partial class ColorManagement : NetDonPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                Bind();

            }
        }


        void Bind()
        {
            var collection = new TitlesettingCollection();
            collection.GetMulti(null);
            this.gridCustomerInfoList.DataSource = collection;
            this.gridCustomerInfoList.DataBind();
        }

        protected void btnReload_Click(object sender, EventArgs e)
        {
            Bind();
        }


        protected void btnSearch_Click(object sender, EventArgs e)
        {
            Bind();
        }

        protected void btnDeleteDemand_Click(object sender, EventArgs e)
        {

            var customerId = fieldCustomerId.Value.ToInt32();
            if (customerId.HasValue)
            {
                bool result = new TitlesettingEntity(customerId.Value).Delete();

                if (result)
                {
                    Bind();
                    Alert("删除成功!");
                }
                else
                {
                    Alert("删除失败！");
                }
            }

        }
        protected string GetHtmlToolColor(object id)
        {
            if (MiscUtilities.IsNullOrEmpty(id)) return string.Empty;

            return new HtmltoolcolorEntity(Convert.ToInt32(id)).Color;
        }


    }
}